package com.cfw.properties;

import java.io.IOException;
import java.util.InvalidPropertiesFormatException;
import java.util.Properties;

import com.cfw.properties.PropertiesHolder;

/**
 * Application Scope에서 사용할 porperties형태의 message를 singleton으로 관리
 * <br/><b>History</b><br/>
 * <pre>
 * 2012. 2. 24. 최초작성s
 * </pre>
 * @author 박형일
 * @version 1.0
 */
final public class MessageProperties {
	private static final String DFT_RTN = "";

	private static PropertiesHolder<MessageProperties> holder = new PropertiesHolder<MessageProperties>(
		new MessageProperties(),
		new PropertiesHolder.AbstractPropertiesLoader() {
			@Override
			public Properties load() {
				final String path =	CustomProperties.getProperty("common.message.location");	
				return PropertiesHolder.loadFromXml(path);
			}			
		},
		MessageProperties.DFT_RTN
	);

	private MessageProperties() {}
	
	public static String getProperty(final String key) { return holder.getString(key); }
	
}
